package com.zhiyou.app.shop.manager.dao.pojo;

import java.io.File;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import com.zhiyou.app.shop.common.util.StringUtil;

/**
 * Goods entity. @author MyEclipse Persistence Tools
 */

public class Goods extends BasePojo {

	// Fields

	private UserDetail userDetail;
	private GoodsCategory goodsCategory;
	private Shop shop;
	private String name;
	private Float price;
	private String remark;
	private String salesPromotionInfo;
	private String shareInfo;
	private Boolean onSale;
	private Boolean isApproved;
	private Integer hitCount;
	private Date createDate;
	private String firstImg;
	private Boolean isDelete = Boolean.FALSE;
	private Set comments = new HashSet(0);
	private Set approveLogs = new HashSet(0);
	private Set<GoodsImg> goodsImgs = new HashSet<GoodsImg>(0);
	
	//view层调用
	private String goodsImgPath;
	
	
	private boolean queryShopInfo = false;
	// Constructors

	/** default constructor */
	public Goods() {
	}

	/** minimal constructor */
	public Goods(UserDetail userDetail, Shop shop, String name, Float price,
			String remark, Boolean onSale, Date createDate) {
		this.userDetail = userDetail;
		this.shop = shop;
		this.name = name;
		this.price = price;
		this.remark = remark;
		this.onSale = onSale;
		this.createDate = createDate;
	}

	// Property accessors

	public Goods(String goodsId) {
		super(goodsId);
	}

	public UserDetail getUserDetail() {
		return this.userDetail;
	}

	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}

	public GoodsCategory getGoodsCategory() {
		return this.goodsCategory;
	}

	public void setGoodsCategory(GoodsCategory goodsCategory) {
		this.goodsCategory = goodsCategory;
	}

	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Float getPrice() {
		return this.price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public String getRemark() {
		return StringUtil.replaceNR(this.remark);
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSalesPromotionInfo() {
		return StringUtil.replaceNR(salesPromotionInfo);
	}

	public void setSalesPromotionInfo(String salesPromotionInfo) {
		this.salesPromotionInfo = salesPromotionInfo;
	}

	public String getShareInfo() {
		return StringUtil.replaceNR(shareInfo);
	}

	public void setShareInfo(String shareInfo) {
		this.shareInfo = shareInfo;
	}

	public Boolean getOnSale() {
		return this.onSale;
	}

	public void setOnSale(Boolean onSale) {
		this.onSale = onSale;
	}

	public Boolean getIsApproved() {
		return this.isApproved;
	}

	public void setIsApproved(Boolean isApproved) {
		this.isApproved = isApproved;
	}

	public Integer getHitCount() {
		return this.hitCount;
	}

	public void setHitCount(Integer hitCount) {
		this.hitCount = hitCount;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Set getComments() {
		return this.comments;
	}

	public void setComments(Set comments) {
		this.comments = comments;
	}

	public Set getApproveLogs() {
		return this.approveLogs;
	}

	public void setApproveLogs(Set approveLogs) {
		this.approveLogs = approveLogs;
	}

	public Set<GoodsImg> getGoodsImgs() {
		return goodsImgs;
	}

	public void setGoodsImgs(Set<GoodsImg> goodsImgs) {
		this.goodsImgs = goodsImgs;
	}

	public String getGoodsImgPath() {
		return goodsImgPath;
	}

	public void setGoodsImgPath(String goodsImgPath) {
		this.goodsImgPath = goodsImgPath;
	}

	public Boolean getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Boolean isDelete) {
		this.isDelete = isDelete;
	}

	/**
	 * 获取商品的第一张图片
	 * @return
	 */
	public String getFirstImg() {
		return this.firstImg;
	}

	public void setFirstImg(String firstImg) {
		this.firstImg = firstImg;
	}

	public boolean isQueryShopInfo() {
		return queryShopInfo;
	}

	public void setQueryShopInfo(boolean queryShopInfo) {
		this.queryShopInfo = queryShopInfo;
	}
	
}